package routers

import (
	"mars-backend/controllers"

	"github.com/astaxie/beego"
)

func UserRouter() {

	// 对应前端用户注册页面 注册
	// beego.Router("/user/login", &controllers.UserController{})
	// 对应前端用户查询页面 GetUserInfo
	// beego.Router("/user/userinfo/:id", &controllers.UserController{}, "get:GetUserInfo")
	// 对应前端用户注册页面 Register
	// beego.Router("/user/register", &controllers.UserController{}, "get:Register")
	// 对应前端用户密码找回页面 ForgetPassword
	// beego.Router("/user/forgetpassword", &controllers.UserController{}, "get:ForgetPassword")

	// 添加用户
	beego.Router("/user/add", &controllers.UserController{}, "post:AddUser")
	// 获取单个用户
	beego.Router("/user/userinfo/:id", &controllers.UserController{}, "get:GetUserById")
	// 按ID更新用户
	beego.Router("/user/update/:id", &controllers.UserController{}, "post:UpdateUser")
	// ?page=1&limit=10 分页获取用户列表
	beego.Router("/user/total", &controllers.UserController{}, "get:GetUserList")
	// ?page=1&limit=10 获取已删除用户列表
	beego.Router("/user/dtotal", &controllers.UserController{}, "get:DeletedUserList")
	// 删除指定用户
	beego.Router("/user/:id", &controllers.UserController{}, "delete:DelOneUser")
	// 批量删除指定用户
	beego.Router("/user/dels", &controllers.UserController{}, "post:DelMultiUser")

	// ?id=userid, 上传头像
	beego.Router("/user/upload", &controllers.UserController{}, "post:UploadFile")

	beego.Router("/user/reset-pwd", &controllers.UserController{}, "post:ResetUserPwd")

	beego.Router("/user/update-basic", &controllers.UserController{}, "post:UpdateBasicInfo")
	beego.Router("/user/update-edu", &controllers.UserController{}, "post:UpdateEducationInfo")
	beego.Router("/user/update-work", &controllers.UserController{}, "post:UpdateWorkInfo")
	beego.Router("/user/update-other", &controllers.UserController{}, "post:UpdateOtherInfo")

}
